//
//  JOFlagView.m
//  选择国旗
//
//  Created by song on 15/1/20.
//  Copyright (c) 2015年 song. All rights reserved.
//

#import "JOFlagView.h"
#import "JOFlag.h"

@implementation JOFlagView

+(instancetype)flagView:(JOFlagView *)view
{
    if(view ==nil)
    {
        return [[[NSBundle mainBundle]loadNibNamed:@"JOFlagView" owner:nil options:nil]lastObject];
    }else{
        return view;
    }
    
}

-(void)setFlag:(JOFlag *)flag
{
    _flag = flag;
    self.flagview.image =[UIImage imageNamed:flag.icon];
    self.nameLabel.text = flag.name;
    
}

@end
